<?php
declare (strict_types=1);

namespace app\admin\controller;


use app\common\builder\TableBuilder;
use app\common\builder\TableFront;
use app\common\tool\Redis;
use think\App;

class PrizeLog extends Base
{

    //主键，默认为id
    protected $pk = 'id';

    //主模型
    protected $model = '\app\common\model\PrizeLog';

    //关联模型
    protected $hasOne = [];

    public function index()
    {
        return $this->setTable();
    }

    public function setTable()
    {
        //构建table
        $table = [
            ['field' => 'id', 'sort' => true, 'title' => 'ID', 'width' => 80],
            ['field' => 'content', 'title' => '修改描述'],
            ['field' => 'admin_name', 'title' => '操作人', 'width' => 160],
            ['field' => 'create_time', 'title' => '时间', 'fixed' => 'right', 'align' => 'center', 'width' => 160],
        ];

        return TableBuilder::getInstance()
            ->addColumns(TableFront::getInstance()->addBatchRows($table))
            ->setSearch($this->setSearch())
            ->fetch();
    }

    public function setSearch()
    {
        return TableFront::getInstance()
            ->setSearch(['content', '输入关键字筛选', 'input', '', '', '', 'like']);
    }

}
